<?php
/**
 * 	           语言资源库
 * 资源提取抽象定义文件。此文件将被所有语言扩展！
 * 在将来多语言系统上将_RES的派生类分别置放到
 * 不同的资源文件内，资源文件可以考虑使用特定格式
 * 以方便程序加载资源文件，将文件完全提交给专业
 * 语言系统人员翻译使用！
 * 
 */
abstract class _RES{
	//PHP调用
	protected  function pString($tag,$fValues){
		$string = "N/A";
		try {
			$CLASS = get_class($this);
			eval("\$string = $CLASS::$tag;");
		}
		catch (Exception $e){
		}
		self::formatString(&$string,$fValues);
		return $string;		
	}
	
	//SMARTY调用
	protected  function tString($tag,$fValues){
		$string = "N/A";
		try {
			$CLASS = get_class($this);
			eval("\$string = $CLASS::$tag;");
		}
		catch (Exception $e){
		}
		self::formatString(&$string,$fValues);
		return $string;		
	}
	
	private function formatString(&$str,$format){
		if(!is_array($format))return;
		$ext = ",";
		foreach($format as $key=>$value){
			$ext .= "\$format['$key'],";
		}
		$ext = preg_replace("/,$/",'',$ext);
		eval("\$str = sprintf(\$str,\$ext);");
	}
	
	public function String($RESOURCE,$formatValue=array()){
		$res_prefix	= strtolower(substr($RESOURCE,0,1));
		$res_getres	= strtoupper(substr($RESOURCE,1,strlen($RESOURCE)));
		$res_method = $res_prefix."String";
		$res_return = "N/A($res_getres)";
		
		if(method_exists('_RES',$res_method)){
			eval("\$res_return = self::$res_method('$res_getres',\$formatValue);");
		}
		return $res_return;
	}
	
	public function Session($value){
		return  isset($_SESSION[_cfg::sessionPrefix.$value])?$_SESSION[_cfg::sessionPrefix.$value]:"";
	}
}


/**
 * 中文资源库
 *
 */
class _CNRES extends _RES{
	const SB_A = "掌声哪！";
	const JS_LOGIN_DEF_A = "用户名";
	const JS_LOGIN_DEF_B = "请输入登录名称！";
	const JS_LOGIN_DEF_C = "密&nbsp;&nbsp;码";
	const JS_LOGIN_DEF_D = "请输入登录密码！";
	const JS_LOGIN_DEF_E = "附加码";
	const JS_LOGIN_DEF_F = "请输入验证码！";
	const JS_LOGIN_DEF_G = "用户登录";
	const JS_LOGIN_DEF_H = "登录";
	const JS_LOGIN_DEF_I = "重置";
	const LOGIN_A_A = "验证码输入有误！";
	const LOGIN_A_B = "帐户密码验证失败！";
	const PERSON_EXECUPDATE_A_A = "帐户密码验证失败！";
	const PERSON_EXECUPDATE_A_B = "密码确认有误，请重试！";
	const PERSON_EXECUPDATE_A_C = "请输入6-30位的密码！";
	public function __construct(){
	}
	public function __destruct(){
	}
}

class _ENRES extends _RES{
	
}

//LoadFile Success!
return md5(__FILE__);